# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=xorbruteforcer
pkgver=0.1
pkgrel=5
groups=('blackarch' 'blackarch-crypto' 'blackarch-cracker')
pkgdesc='Script that implements a XOR bruteforcing of a given file, although a specific key can be used too.'
arch=('any')
url='http://eternal-todo.com/category/bruteforce'
depends=('python2')
source=('http://eternal-todo.com/files/scripts/xorBruteForcer.py')
sha512sums=('f7f7f70632db187e955266815ea316f1065f445918a240515bf710c0ee09af346d64bef1921c9c2a13fadc892c70f5cf0ad6ca1d0f77f1bd4828fccad30584b7')

prepare(){
  sed -i 's|env python$|env python2|' *.py
}

package() {
  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -r --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  chmod +x "$pkgdir/usr/share/$pkgname/xorBruteForcer.py"

  ln -s "/usr/share/$pkgname/xorBruteForcer.py" \
    "$pkgdir/usr/bin/$pkgname"
}

